﻿<Application
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.TourThaiData" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="TourThailand.App"
    >

    <!--Application Resources-->
    <Application.Resources>
    	<SampleData:TourThaiData x:Key="TourThaiData" d:IsDataSource="True"/>
        <local:LocalizedStrings xmlns:local="clr-namespace:TourThailand" x:Key="LocalizedStrings"/>
        <Style x:Key="MenuButton" TargetType="Button">
        	<Setter Property="Background" Value="Transparent"/>
        	<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
        	<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        	<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
        	<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
        	<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
        	<Setter Property="Padding" Value="10,5,10,6"/>
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid x:Name="grid" Background="#FFFFC529">
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="MouseOver"/>
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
        										<DiscreteObjectKeyFrame KeyTime="0">
        											<DiscreteObjectKeyFrame.Value>
        												<SolidColorBrush Color="Red"/>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
        										<DiscreteObjectKeyFrame KeyTime="0">
        											<DiscreteObjectKeyFrame.Value>
        												<SolidColorBrush Color="#FF56AC00"/>
        											</DiscreteObjectKeyFrame.Value>
        										</DiscreteObjectKeyFrame>
        									</ObjectAnimationUsingKeyFrames>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Disabled">
        								<Storyboard>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
        									</ObjectAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
        									</ObjectAnimationUsingKeyFrames>
        									<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
        										<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
        									</ObjectAnimationUsingKeyFrames>
        									<ColorAnimation Duration="0" To="#FF3A2C06" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="grid" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
        						<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
        					</Border>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
        <Style x:Key="WeatherLongListStyle" TargetType="phone:LongListSelector">
        	<Setter Property="Background" Value="Transparent"/>
        	<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="phone:LongListSelector">
        				<Grid Background="{TemplateBinding Background}" d:DesignWidth="480" d:DesignHeight="800">
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="ScrollStates">
        							<VisualStateGroup.Transitions>
        								<VisualTransition GeneratedDuration="00:00:00.5"/>
        							</VisualStateGroup.Transitions>
        							<VisualState x:Name="Scrolling">
        								<Storyboard>
        									<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="VerticalScrollBar"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="NotScrolling"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Grid Margin="{TemplateBinding Padding}">
        						<Grid.ColumnDefinitions>
        							<ColumnDefinition Width="*"/>
        							<ColumnDefinition Width="auto"/>
        						</Grid.ColumnDefinitions>
        						<ViewportControl x:Name="ViewportControl" HorizontalContentAlignment="Stretch" VerticalAlignment="Top"/>
        						<ScrollBar x:Name="VerticalScrollBar" Grid.Column="1" Margin="4,0,4,0" Opacity="0" Orientation="Vertical"/>
        					</Grid>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        </Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService
            Launching="Application_Launching" Closing="Application_Closing"
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>